Optimal Control Method for Wastewater Treatment Process based on Self-Adjusting Multi-Task Particle Swarm Optimization

ABSTRACT

An optimal control method for wastewater treatment process (WWTP) based on a self-adjusting multi-task particle swarm optimization (SA-MTPSO) algorithm belongs to the field of WWTP. To balance the relationship between the effluent water quality (EQ) and energy consumption (EC) and achieve optimization online quickly, the invention establishes a data-based multi-task optimization model for WWTP to describe the relationship between the control variables and EQ, EC. Then, the SA-MTPSO algorithm is adopted to solve the optimal set-points of the nitrate nitrogen and dissolved oxygen concentration for WWTP. The PID controller is used to track the optimal set-points, so as to reduce EC while ensuring EQ, and realize the online optimal control of WWTP.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefits to Chinese Patent Application No. 202110554384.1 filed on May 20, 2021, the content of which is hereby incorporated by reference in its entirety.

Technology Area

The invention relates to an optimal control method for wastewater treatment process based on the self-adjusting multi-task particle swarm optimization algorithm. First, a multi-task optimization model is established by using the data-driven method to obtain the multi-task optimization objective function of wastewater treatment process. Second, the self-adjusting multi-task particle swarm optimization algorithm is adopted to solve the optimal set-points of the nitrate nitrogen and the dissolved oxygen. Finally, PID controller is used to track the optimal set-points, so as to reduce energy consumption while ensuring the quality of effluent water and realize the online optimal control of wastewater treatment process.

Technology Background

With the acceleration of China's urbanization process, water pollution is becoming increasingly prominent, especially the phenomenon of excessive effluent quality and high operation cost. As the key to improve the operation effect and efficiency of municipal wastewater treatment, the optimal control strategy has become an important choice for municipal wastewater treatment plants.

The operation mechanism of wastewater treatment process is complex, and the effluent quality and energy consumption of operation indicators have strong conflict, which makes it difficult to realize online optimal control of wastewater treatment process. Therefore, it is an important research issue to balance the relationship between effluent quality and energy consumption and realize online quick solution of optimal set-points. In the process of establishing the model of effluent quality and energy consumption, it is difficult to determine the mechanism model due to the complexity of wastewater treatment process. Therefore, it is of great significance to adopt the data-based modeling approach for accurately describing the optimization objective of wastewater treatment process. In addition, it takes a long time to solve the optimization set-points, which cannot realize the online optimal control of wastewater treatment process. Therefore, the reasonable optimization method for online optimal control can not only reduce energy consumption while ensuring effluent quality, but also is the key to the stable and efficient operation of wastewater treatment process.

The invention designs an optimal control method for wastewater treatment process based on a self-adjusting multi-task particle swarm optimization algorithm. A data-based multi-task optimization model of wastewater treatment process is established, and the self-adjusting multi-task particle swarm optimization algorithm is adopted to solve the optimal set-points of the nitrate nitrogen and the dissolved oxygen, and the PID controller is used to track the optimal set-points.

SUMMARY

The invention won an optimal control method for wastewater treatment process based on a self-adjusting multi-task particle swarm optimization algorithm. The method includes establishing a multi-task optimization model based on data for wastewater treatment process, adopting the self-adjusting multi-task particle swarm optimization algorithm to solve the optimal set-points of nitrate nitrogen and dissolved oxygen, and using PID controller to track the optimal set-points. Thus, under the condition of ensuring effluent quality, energy consumption can be reduced and the online optimal control of wastewater treatment process can be realized.

The above method includes the following steps:

1. An optimal control method for wastewater treatment process based on a self-adjusting multi-task particle swarm optimization algorithm, comprising the following steps:

(1) collect the process data: the dissolved oxygen is an important indicator of the reaction nitrification process, which is mainly detected by detection instrument of dissolved oxygen; the nitrate nitrogen determines the process of denitrification rate, which is mainly detected by detection instrument of nitrate nitrogen; and the data will be transmitted to programmable logic controller by fieldbus; the programmable logic controller converts the signal into digital or analog quantity and communicates with the master computer through transmission protocol; the master computer obtains real-time data from the wastewater treatment process and stores the collected data in Structured Query Language server database;

(2) design the data-based multi-task optimization model for wastewater treatment process: the multi-task optimization model for wastewater treatment process adopts data-based method to describe the relationship between optimization set-points and effluent quality, energy consumption, including the objective task model based on the kernel function and the auxiliary task model based on the polynomial regression;

{circle around (1)} establish the objective task model of effluent quality and energy consumption based on the kernel function:

$\begin{matrix} {{f_{1}(t)} = {{B_{1}(t)} + {\sum\limits_{z = 1}^{10}{{W_{1,z}(t)}{H_{1,z}(t)}}}}} & (1) \end{matrix}$ $\begin{matrix} {{f_{2}(t)} = {{B_{2}(t)} + {\sum\limits_{z = 1}^{10}{{W_{2,z}(t)}{H_{2,z}(t)}}}}} & (2) \end{matrix}$

where ƒ₁(t) is the objective task model of effluent quality at time t, and ƒ₂(t) is the objective task model of energy consumption at time t; B₁(t) is the output offset of ƒ₁(t) at time t, within [−2, 2], B₂(t) is the output offset of ƒ₂(t) at time t, within [−2, 2]; W_(1,z)(t) is the weight of the zth kernel function of ƒ₁(t) at time t, within [−3, 3], W_(2,z)(t) is the weight of the zth kernel function of ƒ₂(t) at time t, within [−3, 3]; H_(1,z)(t) is the kernel functions related to ƒ1(t) for wastewater treatment process, and H_(2,z)(t) is the kernel functions related to ƒ₂(t) for wastewater treatment process:

H _(1,z)(t)=e ^(−∥x(t)-c) ^(1,z) ^((t)∥) ² ^(/2s) ^(1,z) ^((t)) ²   (3)

H _(2,z)(t)=e ^(−∥x(t)-c) ^(2,z) ^((t)∥) ² ^(/2s) ^(2,z) ^((t)) ²   (4)

where x(t)=[S_(NO)(t), S_(O)(t)] is the input variable at time t, S_(NO)(t) is the anaerobic end nitrate nitrogen concentration by detection instrument of dissolved oxygen at time t, within [0, 2], unit: mg/L, and S_(O)(t) is the concentration of dissolved oxygen at the aerobic terminal by detection instrument of nitrate nitrogen at time t, within [0, 3], unit: mg/L; T is the transpose of a vector or a matrix; c_(1,z)(t)=[c_(1,z,1)(t), c_(1,z,2)(t)]^(T) is the center of the zth kernel function of ƒ₁(t), and the value ranges of c_(1,z,1)(t) and c_(1,z,2)(t) are [−1,1], c_(2,z)(t)=[c_(2,z,1)(t), c_(2,z,2)(t)] ^(T) is the center of the zth kernel function of ƒ₂(t), and the value ranges of c_(2,z,1)(t) and c_(2,z,2)(t) are [−1,1]; σ_(1,z)(t) is the width of the zth kernel function of ƒ₁(t) at time t, within [0, 2], σ_(2,z)(t) is the width of the zth kernel function of ƒ₂(t) at time t, within [0, 2];

{circle around (2)} train the parameters c(t), σ(t) and W(t) of the objective task model for wastewater treatment process:

$\begin{matrix} {{c\left( {t + 1} \right)} = {{c(t)} - {\alpha_{1}\frac{\partial{e_{1u}(t)}}{\partial{c(t)}}}}} & (5) \end{matrix}$ $\begin{matrix} {{\sigma\left( {t + 1} \right)} = {{\sigma(t)} - {\alpha_{2}\frac{\partial{e_{1u}(t)}}{\partial{\sigma(t)}}}}} & (6) \end{matrix}$ $\begin{matrix} {{W\left( {t + 1} \right)} = {{W(t)} - {\alpha_{3}\frac{\partial{e_{1u}(t)}}{\partial{W(t)}}}}} & (7) \end{matrix}$

where c(t)=[c_(1,z)(t), c_(2,z)(t)] is the center of the kernel function for the objective task model at time t, and c(t+1)=[c_(1,z)(t+1), c_(2,z)(t+1)] is the center of the kernel function for the objective task model at time (t+1); σ(t)=[σ_(1,z)(t), σ_(2,z)(t)] is the width of the kernel function for the objective task model at time t, and σ(t+1)=[σ_(1,z)(t+1), σ_(2,z)(t+1)] is the width of the kernel function for the objective task model at time (t+1); W(t)=[W_(1,z)(t), W_(2,z)(t)] is the weight of the kernel function for the objective task model at time t, and W(t+1)=[W_(1,z)(t+1), W_(2,z)(t+1)] is the weight of the kernel function for the objective task model at time (t+1); α₁ is the learning rate of the kernel function center for the objective task model within [0, 1], α₂ is the learning rate of the kernel function width for the objective task model within [0, 1], α₃ is the learning rate of the kernel function weight for the objective task model within [0, 1]; e_(1u)(t)=y₁(t)−y_(u)(t) is the prediction error of the objective task model at time t, y₁(t)=[ƒ₁(t), ƒ₂(t)] is the output of the objective task model at time t, y_(u)(t)=[EQ(t), EC(t)] is the actual output value of wastewater treatment process at time t, EQ(t) is the actual effluent quality value of wastewater treatment process at time t, EC(t) is the actual energy consumption value of wastewater treatment process at time t;

{circle around (3)} establish the auxiliary task model of effluent quality and energy consumption in wastewater treatment process based on the polynomial regression:

$\begin{matrix} {{f_{3}(t)} = {{b_{1}(t)} + {\sum\limits_{q = 0}^{2}{{A_{1,q}(t)}\left( {x(t)} \right)^{q}}}}} & (8) \end{matrix}$ $\begin{matrix} {{f_{4}(t)} = {{b_{2}(t)} + {\sum\limits_{q = 0}^{2}{{A_{2,q}(t)}\left( {x(t)} \right)^{q}}}}} & (9) \end{matrix}$

where ƒ₃(t) is the auxiliary task model of effluent quality at time t, and ƒ₄(t) is the auxiliary task model of energy consumption at time t; b₁(t) is the output offset of ƒ₃(t) at time t, within [−2, 2], b₂(t) is the output offset of ƒ₄(t) at time t, within [−2, 2]; A_(1,q)(t) is the qth coefficient of ƒ₃(t) at time t, within [−3, 3], A_(2,q)(t) is the qth coefficient of ƒ₄(t) at time t, within [−3, 3];

{circle around (4)} train the polynomial coefficient A(t) of the auxiliary task model for wastewater treatment process:

$\begin{matrix} {{A\left( {t + 1} \right)} = {{A(t)} - {\alpha_{4}\frac{\partial{e_{2u}(t)}}{\partial{A(t)}}}}} & (10) \end{matrix}$

where A(t)=[A_(1,q)(t), A_(2,q)(t)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time t, and A(t+1)=[A_(1,q)(t+1), A_(2,q)(t+1)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time (t+1); α₄ is the learning rate of polynomial coefficient for the auxiliary task model within [0, 1]; e_(2u)(t)=y₂(t)−y_(u)(t) is the prediction error of the auxiliary task model at time t, and y₂(t)=[ƒ₃(t), ƒ₄(t)] is the output of the auxiliary task model at time t;

{circle around (5)} establish the multi-task optimization model for wastewater treatment process:

$\begin{matrix} {{{minimize}{F(t)}} = \left\lbrack {{F_{1}(t)},{F_{2}(t)}} \right\rbrack} & (11) \end{matrix}$ $\begin{matrix} \left\{ \begin{matrix} {{F_{1}(t)} = \left\lbrack {{f_{1}(t)},{f_{2}(t)}} \right\rbrack} \\ {{F_{2}(t)} = \left\lbrack {{f_{3}(t)},{f_{4}(t)}} \right\rbrack} \end{matrix} \right. & (12) \end{matrix}$

where, F(t) is the multi-task optimization model of wastewater treatment process at time t, F₁(t) is the objective task model of wastewater treatment process at time t, and F₂(t) is the auxiliary task model of wastewater treatment process at time t;

(3) solve the optimal set-points based on self-adjusting multi-task particle swarm optimization embedded in the master computer: through knowledge transfer between the objective task and the auxiliary task, the self-adjusting multi-task particle swarm optimization algorithm achieves accelerated convergence of the objective task;

{circle around (1)} set the total iteration times of self-adjusting multi-task particle swarm optimization as τ_(max)=500, the particle swarm size as N=100, the number of tasks as K=2, and initialize the external archive U(0) as empty set;

{circle around (2)} the optimization objective of self-adjusting multi-task particle swarm optimization is the data-based multi-task optimization model for wastewater treatment process: min F(t)=[F₁(t), F₂(t)];

{circle around (3)} the position information of particles x_(t)(τ)=[S_(NOt)(τ), S_(Ot)(τ)] is used as input in τ iteration at time t; the fitness and skill factors of particles are calculated, and the particles are divided into different groups according to the skill factors; the fitness ranking of the particles are carried out;

{circle around (4)} evaluate the validity of knowledge carried by particles:

$\begin{matrix} {{E_{t}(t)} = \frac{\sum\limits_{m = 1}^{20}{\left( {{F_{t}^{m}(t)} - {{\overset{¯}{F}}_{t}(t)}} \right)\left( {{g_{t}^{m}(t)} - {\overset{¯}{g_{t}}(t)}} \right)}}{{s\left( {F_{t}(t)} \right)}{s\left( {g_{t}(t)} \right)}}} & (13) \end{matrix}$

where E_(t)(τ) is the knowledge validity of the τ^(th) iteration at time t, F^(m) _(t)(τ)=[F^(m) _(1t)(τ), F^(m) _(2t)(τ)] is the multi-task optimization fitness of the mth particle in τ iteration at time t, F^(m) _(1t)(τ) is the objective task fitness of the mth particle in τ iteration at time t, and F^(m) _(2t)(τ) is the auxiliary task fitness of the mth particle in τ iteration at time t; F _(r)(τ)=[F _(1t)(τ), F _(2t)(τ)] is the mean of fitness for multi-task optimization in τ iteration at time t, F _(1t)(τ) is the mean of fitness for the objective task in τ iteration at time t, F _(2t)(τ) is the mean of fitness for the auxiliary task in τ iteration at time t; F_(t)(τ)=[F_(1t)(τ), F_(2t)(τ)] is the fitness of multitask optimization in τ iteration at time t, F_(1t)(τ) is the fitness of the objective task in τ iteration at time t, F_(2t)(τ) is the fitness of the auxiliary task in τ iteration at time t; g_(t)(τ) is the distance between the objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g^(m) _(t)(τ) is the distance between the mth objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g _(t)(τ) is the mean distance between the objective particle and the global optimal particle of the auxiliary task in τ iteration at time t;

{circle around (5)} design the knowledge transfer strategy:

$\begin{matrix} {{p_{tg}^{*}(t)} = \left\{ \begin{matrix} {p_{tJ}(t)} & {{E_{t}(t)} \leq {E_{t}\left( {t - 1} \right)}} \\ {p_{tJ}\left( {t - 1} \right)} & {{E_{t}(t)} > {E_{t}\left( {t - 1} \right)}} \end{matrix} \right.} & (14) \end{matrix}$

where P*_(tg)(τ)=[p*_(tg,1)(τ), p*_(tg,2)(τ)] is the knowledge transfer term in τ iteration at time t, P_(tJ)(τ)=[p_(tJ,1)(τ), p_(tJ,2)(τ)] is the global optimal solution of the auxiliary task in τ iteration at time t, P_(tJ)(τ−1)=[p_(tJ,1)(τ−1), p_(tJ,2)(τ−1)] is the global optimal solution of the auxiliary task in (τ−1) iteration at time t, and J is the solution with the highest knowledge validity in the Pareto optimal solution set of the auxiliary task at time t:

J=argmin_(j∈{1,2, . . . ,M}) {E _(tj)(t)}  (15)

where E_(tj)(τ) is the knowledge validity of the Jth particle in the Pareto optimal solution set of the auxiliary task in τ iteration at time t;

the particle velocity update formula:

v _(ti)(t+1)=wv _(ti)(t)+c ₁ r ₁(p _(ti)(t)−x _(ti)(t))+c ₂ r ₂(p _(tg)(t)−x _(ti)(t))+c ₃ r ₃(p* _(tg)(t)−x _(ti)(t))  (16)

where v_(ti)(τ+1) is the velocity of the ith particle in (τ+1) iteration at time t, and v_(ti)(τ) is the velocity of the ith particle in τ iteration at time t, x_(ti)(τ+1) is the position of the ith particle in (τ+1) iteration at time t, and x_(ti)(τ) is the position of the ith particle in τ iteration at time t, P_(ti)(τ) is the individual optimal position of the ith particle in τ iteration at time t, and P_(tg)(τ) is the global optimal position of the ith particle in τ iteration at time t; ω=0.8 is the inertia weight; c₁=0.25 is the individual experience acceleration constant, c₂=0.25 is the social experience acceleration constant, c₃=0.25 is the knowledge transfer term acceleration constant; r₁ is the individual experience random number within [0, 1], r₂ is the social experience random number within [0, 1], r₃ is the knowledge transfer item random number within [0, 1];

{circle around (6)} by comparing the individual optimal position P_(ti)(τ) with the solution of the archive Φ_(t)(τ−1) in τ iteration at time t, the archive Φ_(t)(τ) is updated:

$\begin{matrix} \left\{ {\begin{matrix} {{\Phi_{t}(\tau)} = {{\Phi_{t}\left( {\tau - 1} \right)}\bigcup{P_{ti}(\tau)}\ }} & {{if}{F_{1}\left( {\varphi_{t}\left( {\tau - \iota} \right)} \right)}\ldots{F_{1}\left( {P_{ti}(\tau)} \right)}} \\ {{\Phi_{t}(\tau)} = {\Phi_{t}\left( {\tau - 1} \right)}\ } & {else} \end{matrix},{\iota = 1},2,\ldots,{t - 1}} \right. & (17) \end{matrix}$

where ∪ is logic relationship “union”, Φ_(t)(τ−1)=[φ_(t)(τ−1), φ_(t)(τ−2), φ_(t)(τ−ι), . . . , φ_(t)(1)], φ_(t)(τ−ι) is the ιth optimal solution of archives in τ iteration, F₁(φ_(t)(τ−ι)) is the objective tasks fitness of φ_(t)(τ−ι), F₁(P_(ti)(τ)) is the objective tasks fitness of P_(ti)(τ);

{circle around (7)} judge whether to stop iteration: if the current iteration number τ≥τ_(max), terminate the iteration process and go to step {circle around (8)}; otherwise, the iteration number τ increases by 1 and go back to step {circle around (3)};

{circle around (8)} a solution is randomly selected from the archives Φ_(t)(τ_(max)) as the optimal set-points at time t u*(t)=[S*_(NO)(t), S*_(O)(t)], where S*_(NO)(t) is the optimal set-point of nitrate nitrogen at time t and S*_(O)(t) is the optimal set-point of dissolved oxygen at time t;

(4) track control of the optimal set-points: the multivariable proportion integral differential controller is used to track and control the optimal set-points, and the control signal is transmitted to the programmable logic controller though Object Linking and Embedding for Process Control of communication; the analog signal is converted to digital signal through the analog digital converter; the digital signal is transferred to the frequency converter by fieldbus, to control the frequency of oxygen supply pump and reflux pump, and realize the optimal control of effluent water quality and energy consumption for wastewater treatment process;

{circle around (1)} proportion integral differential controller performs tracking control on the optimal set-points S*_(NO)(t) and S*_(O)(t):

$\begin{matrix} {{\Delta{u(t)}} = {K_{p}\left\lbrack {{e(t)} + {H_{l}{\int_{0}^{t}{{e(t)}{dt}}}} + {H_{d}\frac{{de}(t)}{dt}}} \right\rbrack}} & (18) \end{matrix}$

where Δu(t)=[ΔQ_(a)(t), ΔK_(L)a(t)]^(T) is the operational variable matrix, ΔQ_(a)(t) is the change of the circulating flow, ΔK_(L)a(t) is the change of the oxygen transfer coefficient in the fifth zone; K_(p) is the proportional coefficient, H_(l) is the integral coefficient, H_(d) is the differential coefficient; e(t)=y*(t)−y(t) is control error at time t, y*(t)=[S*_(NO)(t), S*_(O)(t)]^(T) is the optimal set-points at time t, y(t)=[S_(NO)(t), S_(O)(t)]^(T) is the actual output values at time t;

{circle around (2)} adjust the transfer coefficient of the dissolved oxygen and the internal return flow:

K _(L) a(t+1)=K _(L) a(t)−ΔK _(L) a(t)  (19)

Q _(a)(t+1)=Q _(a)(t)+ΔQ _(a)(t)  (20)

where K_(L)a(t+1) is the transfer coefficient of dissolved oxygen at time (t+1), K_(L)a(t) is the transfer coefficient of the dissolved oxygen at time t; Q_(a)(t+1) is the inner return flow at time (t+1), Q_(a)(t) is the inner return flow at time t; when the frequency of oxygen supply pump and reflux pump is adjusted by frequency converter, the concentration of nitrate nitrogen will be adjusted to S*_(NO)(t) and the concentration of dissolved oxygen will be adjusted to S*_(O)(t); thus, the optimal control of effluent quality and energy consumption for wastewater treatment process is realized.

The Novelties of this Patent Contain:

(1) Aim at the problem that it is difficult to balance the conflict relationship between effluent quality and energy consumption, and difficult to implement online to solve the optimal value, the invention proposed an optimal control method for wastewater treatment process based on a self-adjusting multi-task particle swarm optimization algorithm. The method includes establishing a multi-task optimization model based on data for wastewater treatment process, adopting the self-adjusting multi-task particle swarm optimization algorithm to solve the optimal set-points of nitrate nitrogen and dissolved oxygen, and using PID controller to track the optimal set-points. Thus, under the condition of ensuring effluent quality, energy consumption can be reduced and the online optimal control of wastewater treatment process can be realized.

(2) The invention adopts the self-adjusting multi-task particle swarm optimization algorithm to solve the optimal set-points of the nitrate nitrogen and the dissolved oxygen. The method evaluates the validity of the knowledge carried by particles and selects the most effective information for knowledge transfer. The self-adjusting mechanism can guide the particle swarm to the position with better convergence, and finally get the optimal set-points faster, which is conducive to realize the optimal control online for wastewater treatment process.

Attention: the invention adopts the data-driven model based on kernel function and polynomial regression to establish the multi-task optimization model, and uses self-adjusting multi-task particle swarm optimization algorithm to optimize the set-points of nitrate nitrogen and dissolved oxygen for wastewater treatment process. Other data-based modeling methods and multi-task optimal control methods based on multi-task particle swarm optimization algorithm should fall within the scope of the invention.

DESCRIPTION OF DRAWINGS

FIG. 1 is the nitrate nitrogen result of the optimal control method.

FIG. 2 is the nitrate nitrogen tracking error of the optimal control method.

FIG. 3 is the dissolved oxygen result of the optimal control method.

FIG. 4 is the dissolved oxygen tracking error of the optimal control method.

DETAILED DESCRIPTION OF THE INVENTION

(1) collect the process data: the dissolved oxygen is an important indicator of the reaction nitrification process, which is mainly detected by detection instrument of dissolved oxygen; the nitrate nitrogen determines the process of denitrification rate, which is mainly detected by detection instrument of nitrate nitrogen; and the data will be transmitted to programmable logic controller by fieldbus; the programmable logic controller converts the signal into digital or analog quantity and communicates with the master computer through transmission protocol; the master computer obtains real-time data from the wastewater treatment process and stores the collected data in Structured Query Language server database;

(2) design the data-based multi-task optimization model for wastewater treatment process: the multi-task optimization model for wastewater treatment process adopts data-based method to describe the relationship between optimization set-points and effluent quality, energy consumption, including the objective task model based on the kernel function and the auxiliary task model based on the polynomial regression;

{circle around (1)} establish the objective task model of effluent quality and energy consumption based on the kernel function:

$\begin{matrix} {{f_{1}(t)} = {{B_{1}(t)} + {\sum\limits_{z = 1}^{10}{{W_{1,z}(t)}{H_{1,z}(t)}}}}} & (21) \end{matrix}$ $\begin{matrix} {{f_{2}(t)} = {{B_{2}(t)} + {\sum\limits_{z = 1}^{10}{{W_{2,z}(t)}{H_{2,z}(t)}}}}} & (22) \end{matrix}$

where ƒ₁(t) is the objective task model of effluent quality at time t, and ƒ₂(t) is the objective task model of energy consumption at time t; B₁(t) is the output offset of ƒ₁(t) at time t, within [−2, 2], B₁(0)=−1.01, B₂(t) is the output offset of ƒ₂(t) at time t, within [−2, 2], B₂(0)=0.32; W_(1,z)(t) is the weight of the zth kernel function of ƒ₁(t) at time t, within [−3, 3], W_(1,z)(0)=1.8, W_(2,z)(t) is the weight of the zth kernel function of ƒ₂(t) at time t, within [−3, 3], W_(2,z)(0)=2.4; H_(1,z)(t) is the kernel functions related to ƒ₁(t) for wastewater treatment process, and H_(2,z)(t) is the kernel functions related to ƒ₂(t) for wastewater treatment process:

H _(1,z)(t)=e ^(−∥x(t)-c) ^(1,z) ^((t)∥) ² ^(/2s) ^(1,z) ^((t)) ²   (23)

H _(2,z)(t)=e ^(−∥x(t)-c) ^(2,z) ^((t)∥) ² ^(/2s) ^(2,z) ^((t)) ²   (24)

where x(t)=[S_(NO)(t), S_(O)(t)] is the input variable at time t, S_(NO)(t) is the anaerobic end nitrate nitrogen concentration by detection instrument of dissolved oxygen at time t, within [0, 2], unit: mg/L, and S_(O)(t) is the concentration of dissolved oxygen at the aerobic terminal by detection instrument of nitrate nitrogen at time t, within [0, 3], unit: mg/L, S_(O)(0)=1.5 mg/L; T is the transpose of a vector or a matrix; c_(1,z)(t)=[c_(1,z,1)(t), c_(1,z,2)(t)]^(T) is the center of the zth kernel function of ƒ₁(t), and the value ranges of c_(1,z,1)(t) and c_(1,z,2)(t) are [−1, 1], c_(1,z,1)(0)=0.76, c_(1,z,2)(0)=0.45, c_(2,z)(t)=[c_(2,z,1)(t), c_(2,z,2)(t)]^(T) is the center of the zth kernel function of ƒ₂(t), and the value ranges of c_(2,z,1)(t) and c_(2,z,2)(t) are [−1, 1], c_(2,z,1)(0)=0.82, c_(2,z,2)(0)=0.67; σ_(1,z)(t) is the width of the zth kernel function of ƒ₁(t) at time t, within [0, 2], σ_(1,z)(0)=1.72, σ_(2,z)(t) is the width of the zth kernel function of ƒ₂(t) at time t, within [0, 2], σ_(2,z)(0)=0.62;

{circle around (2)} train the parameters c(t), σ(t) and W(t) of the objective task model for wastewater treatment process:

$\begin{matrix} {{c\left( {t + 1} \right)} = {{c(t)} - {\alpha_{1}\frac{\partial{e_{1u}(t)}}{\partial{c(t)}}}}} & (25) \end{matrix}$ $\begin{matrix} {{\sigma\left( {t + 1} \right)} = {{\sigma(t)} - {\alpha_{2}\frac{\partial{e_{1u}(t)}}{\partial{\sigma(t)}}}}} & (26) \end{matrix}$ $\begin{matrix} {{W\left( {t + 1} \right)} = {{W(t)} - {\alpha_{3}\frac{\partial{e_{1u}(t)}}{\partial{W(t)}}}}} & (27) \end{matrix}$

where c(t)=[c_(1,z)(t), c_(2,z)(t)] is the center of the kernel function for the objective task model at time t, and c(t+1)=[c_(1,z)(t+1), c_(2,z)(t+1)] is the center of the kernel function for the objective task model at time (t+1); σ(t)=[σ_(1,z)(t), σ_(2,z)(t)] is the width of the kernel function for the objective task model at time t, and σ(t+1)=[σ_(1,z)(t+1), σ_(2,z)(t+1)] is the width of the kernel function for the objective task model at time (t+1); W(t)=[W_(1,z)(t), W_(2,z)(t)] is the weight of the kernel function for the objective task model at time t, and W(t+1)=[W_(1,z)(t+1), W_(2,z)(t+1)] is the weight of the kernel function for the objective task model at time (t+1); α₁ is the learning rate of the kernel function center for the objective task model within [0, 1], α₂ is the learning rate of the kernel function width for the objective task model within [0, 1], α₃ is the learning rate of the kernel function weight for the objective task model within [0, 1]; e_(1u)(t)=y₁(t)−y_(u)(t) is the prediction error of the objective task model at time t, y₁(t)=[ƒ₁(t), ƒ₂(t)] is the output of the objective task model at time t, y_(u)(t)=[EQ(t), EC(t)] is the actual output value of wastewater treatment process at time t, EQ(t) is the actual effluent quality value of wastewater treatment process at time t, EC(t) is the actual energy consumption value of wastewater treatment process at time t;

{circle around (3)} establish the auxiliary task model of effluent quality and energy consumption in wastewater treatment process based on the polynomial regression:

$\begin{matrix} {{f_{3}(t)} = {{b_{1}(t)} + {\sum\limits_{q = 0}^{2}{{A_{1,q}(t)}\left( {x(t)} \right)^{q}}}}} & (28) \end{matrix}$ $\begin{matrix} {{f_{4}(t)} = {{b_{2}(t)} + {\sum\limits_{q = 0}^{2}{{A_{2,q}(t)}\left( {x(t)} \right)^{q}}}}} & (29) \end{matrix}$

where ƒ₃(t) is the auxiliary task model of effluent quality at time t, and ƒ₄(t) is the auxiliary task model of energy consumption at time t; b₁(t) is the output offset of ƒ₃(t) at time t, within [−2, 2], b₁(0)=−1.5, b₂(t) is the output offset of ƒ₄(t) at time t, within [−2, 2], b₂(0)=−0.84; A_(1,q)(t) is the qth coefficient of ƒ₃(t) at time t, within [−3, 3], A_(1,q)(0)=0.56, A_(1,q)(t) is the qth coefficient of ƒ₄(t) at time t, within [−3, 3], A_(2,q)(0)=1.34;

{circle around (4)} train the polynomial coefficient A(t) of the auxiliary task model for wastewater treatment process:

$\begin{matrix} {{A\left( {t + 1} \right)} = {{A(t)} - {\alpha_{4}\frac{\partial{e_{2u}(t)}}{\partial{A(t)}}}}} & (30) \end{matrix}$

where A(t)=[A_(1,q)(t), A_(2,q)(t)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time t, and A(t+1)=[A_(1,q)(t+1), A_(2,q)(t+1)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time (t+1); α₄ is the learning rate of polynomial coefficient for the auxiliary task model within [0, 1]; e_(2u)(t)=y₂(t)−y_(u)(t) is the prediction error of the auxiliary task model at time t, and y₂(t)=[ƒ₃(t), ƒ₄(t)] is the output of the auxiliary task model at time t;

{circle around (5)} establish the multi-task optimization model for wastewater treatment process:

$\begin{matrix} {{{minimize}{F(t)}} = \left\lbrack {{F_{1}(t)},{F_{2}(t)}} \right\rbrack} & (31) \end{matrix}$ $\begin{matrix} \left\{ \begin{matrix} {{F_{1}(t)} = \left\lbrack {{f_{1}(t)},{f_{2}(t)}} \right\rbrack} \\ {{F_{2}(t)} = \left\lbrack {{f_{3}(t)},{f_{4}(t)}} \right\rbrack} \end{matrix} \right. & (32) \end{matrix}$

where, F(t) is the multi-task optimization model of wastewater treatment process at time t, F₁(t) is the objective task model of wastewater treatment process at time t, and F₂(t) is the auxiliary task model of wastewater treatment process at time t;

(3) solve the optimal set-points based on self-adjusting multi-task particle swarm optimization embedded in the master computer: through knowledge transfer between the objective task and the auxiliary task, the self-adjusting multi-task particle swarm optimization algorithm achieves accelerated convergence of the objective task;

{circle around (1)} set the total iteration times of self-adjusting multi-task particle swarm optimization as τ_(max)=500, the particle swarm size as N=100, the number of tasks as K=2, and initialize the external archive U(0) as empty set;

{circle around (2)} the optimization objective of self-adjusting multi-task particle swarm optimization is the data-based multi-task optimization model for wastewater treatment process: min F(t)=[F₁(t), F₂(t)];

{circle around (3)} in τ iteration at time t, the position information of particles x_(t)(τ)=[S_(NOt)(τ), S_(Ot)(τ)] is used as input; the fitness and skill factors of particles are calculated, and the particles are divided into different groups according to the skill factors; the fitness ranking of the particles are carried out;

{circle around (4)} evaluate the validity of knowledge carried by particles:

$\begin{matrix} {{E_{t}(t)} = \frac{\sum\limits_{m = 1}^{20}{\left( {{F_{t}^{m}(t)} - {{\overset{\_}{F}}_{t}(t)}} \right)\left( {{g_{t}^{m}(t)} - {\overset{\_}{g_{t}}(t)}} \right)}}{{s\left( {F_{t}(t)} \right)}{s\left( {g_{t}(t)} \right)}}} & (33) \end{matrix}$

where E_(t)(τ) is the knowledge validity of the τth iteration at time t, F^(m) _(t)(τ)=[F^(m) _(1t)(τ), F^(m) _(2t)(τ)] is the multi-task optimization fitness of the mth particle in τ iteration at time t, F^(m) _(1t)(τ) is the objective task fitness of the mth particle in τ iteration at time t, and F^(m) _(2t)(τ) is the auxiliary task fitness of the mth particle in τ iteration at time t; F _(t)(τ)=[F _(1t)(τ), F _(2t)(τ)] is the mean of fitness for multi-task optimization in τ iteration at time t, F _(1t)(t) is the mean of fitness for the objective task in τ iteration at time t, F _(2t)(τ) is the mean of fitness for the auxiliary task in τ iteration at time t; F_(t)(τ)=[F_(1t)(τ), F_(2t)(τ)] is the fitness of multitask optimization in τ iteration at time t, F_(1t)(τ) is the fitness of the objective task in τ iteration at time t, F_(2t)(τ) is the fitness of the auxiliary task in τ iteration at time t; g_(t)(τ) is the distance between the objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g^(m) _(t)(τ) is the distance between the mth objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g _(t)(τ) is the mean distance between the objective particle and the global optimal particle of the auxiliary task in τ iteration at time t;

{circle around (5)} design the knowledge transfer strategy:

$\begin{matrix} {{p_{tg}^{*}(t)} = \left\{ \begin{matrix} {p_{tJ}(t)} & {{E_{t}(t)} \leq {E_{t}\left( {t - 1} \right)}} \\ {p_{tJ}\left( {t - 1} \right)} & {{E_{t}(t)} > {E_{t}\left( {t - 1} \right)}} \end{matrix} \right.} & (34) \end{matrix}$

where P*_(tg)(τ)=[p*_(tg,1)(τ), p*_(tg,2)(τ)] is the knowledge transfer term in τ iteration at time t, P_(tJ)(τ)=[p_(tJ,1)(τ), p_(tJ,2)(τ)] is the global optimal solution of the auxiliary task in τ iteration at time t, P_(tJ)(τ−1)=[p_(tJ,1)(τ−1), p_(tJ,2)(τ−1)] is the global optimal solution of the auxiliary task in (τ−1) iteration at time t, and J is the solution with the highest knowledge validity in the Pareto optimal solution set of the auxiliary task at time t:

J=argmin_(j∈{1,2, . . . ,M}) {E _(tj)(t)}  (35)

where E_(tj)(τ) is the knowledge validity of the Jth particle in the Pareto optimal solution set of the auxiliary task in τ iteration at time t;

the particle velocity update formula:

v _(ti)(t+1)=wv _(ti)(t)+c ₁ r ₁(p _(ti)(t)−x _(ti)(t))+c ₂ r ₂(p _(tg)(t)−x _(ti)(t))+c ₃ r ₃(p* _(tg)(t)−x _(ti)(t))  (36)

where v_(ti)(τ+1) is the velocity of the ith particle in (τ+1) iteration at time t, and v_(ti)(τ) is the velocity of the ith particle in τ iteration at time t, x_(ti)(τ+1) is the position of the ith particle in (τ+1) iteration at time t, and x_(ti)(τ) is the position of the ith particle in τ iteration at time t, P_(ti)(τ) is the individual optimal position of the ith particle in τ iteration at time t, and P_(tg)(τ) is the global optimal position of the ith particle in τ iteration at time t; ω=0.8 is the inertia weight; c₁=0.25 is the individual experience acceleration constant, c₂=0.25 is the social experience acceleration constant, c₃=0.25 is the knowledge transfer term acceleration constant; r₁ is the individual experience random number within [0, 1], r₂ is the social experience random number within [0, 1], r₃ is the knowledge transfer item random number within [0, 1];

{circle around (6)} by comparing the individual optimal position P_(ti)(τ) in τ iteration at time t with the solution of the archive Φ_(t)(τ−1) in τ iteration at time t, the archive Φ_(t)(τ) is updated:

$\begin{matrix} \left\{ {\begin{matrix} {{\Phi_{t}(\tau)} = {{\Phi_{t}\left( {\tau - 1} \right)}\bigcup{P_{ti}(\tau)}}} & {{if}{F_{1}\left( {\varphi_{t}\left( {\tau - \iota} \right)} \right)}\ldots{F_{1}\left( {P_{ti}(\tau)} \right)}} \\ {{\Phi_{t}(\tau)} = {\Phi_{t}\left( {\tau - 1} \right)}} & {else} \end{matrix},{\iota = 1},2,\ldots,{t - 1}} \right. & (37) \end{matrix}$

where ∪ is logic relationship “union”, Φ_(t)(τ−1)=[φ_(t)(τ−1), φ_(t)(τ−2), φ_(t)(τ−ι), . . . , φ_(t)(1)], φ_(t)(τ−1) is the ith optimal solution of archives in τ iteration, F₁(φ_(t)(τ−ι)) is the objective tasks fitness of φ_(t)(τ−ι), F₁(P_(ti)(τ)) is the objective tasks fitness of P_(ti)(τ);

{circle around (7)} judge whether to stop iteration: if the current iteration number τ≥τ_(max), terminate the iteration process and go to step {circle around (8)}; otherwise, the iteration number τ increases by 1 and go back to step {circle around (3)};

{circle around (8)} a solution is randomly selected from the archives Φ_(t)(τ_(max)) as the optimal set-points at time t u*(t)=[S*_(NO)(t), S*_(O)(t)], where S*_(NO)(t) is the optimal set-point of nitrate nitrogen at time t and S*_(O)(t) is the optimal set-point of dissolved oxygen at time t;

(4) tracking control of the optimal set-points: the multivariable proportion integral differential controller is used to track and control the optimal set-points, and the control signal is transmitted to the programmable logic controller though Object Linking and Embedding for Process Control of communication; the analog signal is converted to digital signal through the analog digital converter; the digital signal is transferred to the frequency converter by fieldbus, to control the frequency of oxygen supply pump and reflux pump, and realize the optimal control of effluent water quality and energy consumption for wastewater treatment process;

{circle around (1)} PID controller performs tracking control on the optimal set-points S*_(NO)(t) and S*_(O)(t):

$\begin{matrix} {{\Delta{u(t)}} = {K_{p}\left\lbrack {{e(t)} + {H_{l}{\int_{0}^{t}{{e(t)}{dt}}}} + {H_{d}\frac{{de}(t)}{dt}}} \right\rbrack}} & (38) \end{matrix}$

where Δu(t)=[ΔQ_(a)(t), ΔK_(L)a(t)]^(T) is the operational variable matrix, ΔQ_(a)(t) is the change of the circulating flow, ΔK_(L)a(t) is the change of the oxygen transfer coefficient in the fifth zone; K_(p) is the proportional coefficient, H_(l) is the integral coefficient, H_(d) is the differential coefficient; e(t)=y*(t)−y(t) is control error at time t, y*(t)=[S*_(NO)(t), S*_(O)(t)]^(T) is the optimal set-points at time t, y(t)=[S_(NO)(t), S_(O)(t)]^(T) is the actual output values at time t;

{circle around (2)} adjust the transfer coefficient of the dissolved oxygen and the internal return flow:

K _(L) a(t+1)=K _(L) a(t)+ΔK _(L) a(t)  (39)

Q _(a)(t+1)=Q _(a)(t)+ΔQ _(a)(t)  (40)

where K_(L)a(t+1) is the transfer coefficient of dissolved oxygen at time (t+1), K_(L)a(t) is the transfer coefficient of the dissolved oxygen at time t; Q_(a)(t+1) is the inner return flow at time (t+1), Q_(a)(t) is the inner return flow at time t; when the frequency of oxygen supply pump and reflux pump is adjusted by frequency converter, the concentration of nitrate nitrogen will be adjusted to S*_(NO)(t) and the concentration of dissolved oxygen will be adjusted to S*_(O)(t); thus, the optimal control of effluent quality and energy consumption for wastewater treatment process is realized.

An optimal control system for wastewater treatment process based on self-adjusting multi-task particle swarm optimization algorithm outputs the concentrations of nitrate nitrogen and dissolved oxygen. FIG. 1 shows nitrate nitrogen results, where the solid line is the optimal set-point and the dotted line is the actual output value. X-axis: time, in days, Y-axis: nitrate nitrogen concentration, in mg/L. FIG. 2 is the nitrate nitrogen tracking error. X-axis: time, in days, Y-axis: nitrate nitrogen tracking error, in mg/L. FIG. 3 is the dissolved oxygen result, where the solid line is the optimal set-point and the dotted line is the actual output value. X-axis: time, in days, and Y-axis: dissolved oxygen concentration, in mg/L. FIG. 4 is the dissolved oxygen tracking error. X-axis: time, in days, Y-axis: dissolved oxygen tracking error, in mg/L. 

What is claimed is:
 1. An optimal control method for wastewater treatment process based on a self-adjusting multi-task particle swarm optimization algorithm, comprising the following steps: (1) collect the process data: the dissolved oxygen is an important indicator of the reaction nitrification process, which is mainly detected by detection instrument of dissolved oxygen; the nitrate nitrogen determines the process of denitrification rate, which is mainly detected by detection instrument of nitrate nitrogen; and the data will be transmitted to programmable logic controller by fieldbus; the programmable logic controller converts the signal into digital or analog quantity and communicates with the master computer through transmission protocol; the master computer obtains real-time data from the wastewater treatment process and stores the collected data in Structured Query Language server database; (2) design the data-based multi-task optimization model for wastewater treatment process: the multi-task optimization model for wastewater treatment process adopts data-based method to describe the relationship between optimization set-points and effluent quality, energy consumption, including the objective task model based on the kernel function and the auxiliary task model based on the polynomial regression; {circle around (1)} establish the objective task model of effluent quality and energy consumption based on the kernel function: $\begin{matrix} {{f_{1}(t)} = {{B_{1}(t)} + {\sum\limits_{z = 1}^{10}{{W_{1,z}(t)}{H_{1,z}(t)}}}}} & (1) \end{matrix}$ $\begin{matrix} {{f_{2}(t)} = {{B_{2}(t)} + {\sum\limits_{z = 1}^{10}{{W_{2,z}(t)}{H_{2,z}(t)}}}}} & (2) \end{matrix}$ where ƒ₁(t) is the objective task model of effluent quality at time t, and ƒ₂(t) is the objective task model of energy consumption at time t; B₁(t) is the output offset of ƒ₁(t) at time t, within [−2, 2], B₂(t) is the output offset of ƒ₂(t) at time t, within [−2, 2]; W_(1,z)(t) is the weight of the zth kernel function of ƒ₁(t) at time t, within [−3, 3], W_(2,z)(t) is the weight of the zth kernel function of ƒ₂(t) at time t, within [−3, 3]; H_(1,z)(t) is the kernel functions related to ƒ₁(t) for wastewater treatment process, and H_(2,z)(t) is the kernel functions related to ƒ₂(t) for wastewater treatment process: H _(1,z)(t)=e ^(−∥x(t)-c) ^(1,z) ^((t)∥) ² ^(/2s) ^(1,z) ^((t)) ²   (3) H _(2,z)(t)=e ^(−∥x(t)-c) ^(2,z) ^((t)∥) ² ^(/2s) ^(2,z) ^((t)) ²   (4) where x(t)=[S_(NO)(t), S_(O)(t)] is the input variable at time t, S_(NO)(t) is the anaerobic end nitrate nitrogen concentration by detection instrument of dissolved oxygen at time t, within [0, 2], unit: mg/L, and S_(O)(t) is the concentration of dissolved oxygen at the aerobic terminal by detection instrument of nitrate nitrogen at time t, within [0, 3], unit: mg/L; T is the transpose of a vector or a matrix; c_(1,z)(t)=[c_(1,z,1)(t), c_(1,z,2)(t)]^(T) is the center of the zth kernel function of ƒ₁(t), and the value ranges of c_(1,z,1)(t) and c_(1,z,2)(t) are [−1,1], c_(2,z)(t)=[c_(2,z,1)(t), c_(2,z,2)(t)]^(T) is the center of the zth kernel function of ƒ₂(t), and the value ranges of c_(2,z,1)(t) and c_(2,z,2)(t) are [−1,1]; σ_(1,z)(t) is the width of the zth kernel function of ƒ₁(t) at time t, within [0, 2], σ_(2,z)(t) is the width of the zth kernel function of ƒ₂(t) at time t, within [0, 2]; {circle around (2)} train the parameters c(t), σ(t) and W(t) of the objective task model for wastewater treatment process: $\begin{matrix} {{c\left( {t + 1} \right)} = {{c(t)} - {\alpha_{1}\frac{\partial{e_{1u}(t)}}{\partial{c(t)}}}}} & (5) \end{matrix}$ $\begin{matrix} {{\sigma\left( {t + 1} \right)} = {{\sigma(t)} - {\alpha_{2}\frac{\partial{e_{1u}(t)}}{\partial{\sigma(t)}}}}} & (6) \end{matrix}$ $\begin{matrix} {{W\left( {t + 1} \right)} = {{W(t)} - {\alpha_{3}\frac{\partial{e_{1u}(t)}}{\partial{W(t)}}}}} & (7) \end{matrix}$ where c(t)=[c_(1,z)(t), c_(2,z)(t)] is the center of the kernel function for the objective task model at time t, and c(t+1)=[c_(1,z)(t+1), c_(2,z)(t+1)] is the center of the kernel function for the objective task model at time (t+1); σ(t)=[σ_(1,z)(t), σ_(2,z)(t)] is the width of the kernel function for the objective task model at time t, and σ(t+1)=[σ_(1,z)(t+1), σ_(2,z)(t+1)] is the width of the kernel function for the objective task model at time (t+1); W(t)=[W_(1,z)(t), W_(2,z)(t)] is the weight of the kernel function for the objective task model at time t, and W(t+1)=[W_(1,z)(t+1), W_(2,z)(t+1)] is the weight of the kernel function for the objective task model at time (t+1); α₁ is the learning rate of the kernel function center for the objective task model within [0, 1], α₂ is the learning rate of the kernel function width for the objective task model within [0, 1], α₃ is the learning rate of the kernel function weight for the objective task model within [0, 1]; e_(1u)(t)=y₁(t)−y_(u)(t) is the prediction error of the objective task model at time t, y₁(t)=[ƒ₁(t), ƒ₂(t)] is the output of the objective task model at time t, y_(u)(t)=[EQ(t), EC(t)] is the actual output value of wastewater treatment process at time t, EQ(t) is the actual effluent quality value of wastewater treatment process at time t, EC(t) is the actual energy consumption value of wastewater treatment process at time t; {circle around (3)} establish the auxiliary task model of effluent quality and energy consumption in wastewater treatment process based on the polynomial regression: $\begin{matrix} {{f_{3}(t)} = {{b_{1}(t)} + {\sum\limits_{q = 0}^{2}{{A_{1,q}(t)}\left( {x(t)} \right)^{q}}}}} & (8) \end{matrix}$ $\begin{matrix} {{f_{4}(t)} = {{b_{2}(t)} + {\sum\limits_{q = 0}^{2}{{A_{2,q}(t)}\left( {x(t)} \right)^{q}}}}} & (9) \end{matrix}$ where ƒ₃(t) is the auxiliary task model of effluent quality at time t, and ƒ₄(t) is the auxiliary task model of energy consumption at time t; b₁(t) is the output offset of ƒ₃(t) at time t, within [−2, 2], b₂(t) is the output offset of ƒ₄(t) at time t, within [−2, 2]; A_(1,q)(t) is the qth coefficient of ƒ₃(t) at time t, within [−3, 3], A_(2,q)(t) is the qth coefficient of ƒ₄(t) at time t, within [−3, 3]; {circle around (4)} train the polynomial coefficient A(t) of the auxiliary task model for wastewater treatment process: $\begin{matrix} {{A\left( {t + 1} \right)} = {{A(t)} - {\alpha_{4}\frac{\partial{e_{2u}(t)}}{\partial{A(t)}}}}} & (10) \end{matrix}$ where A(t)=[A_(1,q)(t), A_(2,q)(t)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time t, and A(t+1)=[A_(1,q)(t+1), A_(2,q)(t+1)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time (t+1); α₄ is the learning rate of polynomial coefficient for the auxiliary task model within [0, 1]; e_(2u)(t)=y₂(t)−y_(u)(t) is the prediction error of the auxiliary task model at time t, and y₂(t)=[ƒ₃(t), ƒ₄(t)] is the output of the auxiliary task model at time t; {circle around (5)} establish the multi-task optimization model for wastewater treatment process: $\begin{matrix} {{{minimize}{F(t)}} = \left\lbrack {{F_{1}(t)},{F_{2}(t)}} \right\rbrack} & (11) \end{matrix}$ $\begin{matrix} \left\{ \begin{matrix} {{F_{1}(t)} = \left\lbrack {{f_{1}(t)},{f_{2}(t)}} \right\rbrack} \\ {{F_{2}(t)} = \left\lbrack {{f_{3}(t)},{f_{4}(t)}} \right\rbrack} \end{matrix} \right. & (12) \end{matrix}$ where, F(t) is the multi-task optimization model of wastewater treatment process at time t, F₁(t) is the objective task model of wastewater treatment process at time t, and F₂(t) is the auxiliary task model of wastewater treatment process at time t; (3) solve the optimal set-points based on self-adjusting multi-task particle swarm optimization embedded in the master computer: through knowledge transfer between the objective task and the auxiliary task, the self-adjusting multi-task particle swarm optimization algorithm achieves accelerated convergence of the objective task; {circle around (1)} set the total iteration times of self-adjusting multi-task particle swarm optimization as τ_(max)=500, the particle swarm size as N=100, the number of tasks as K=2, and initialize the external archive U(0) as empty set; {circle around (2)} the optimization objective of self-adjusting multi-task particle swarm optimization is the data-based multi-task optimization model for wastewater treatment process: min F(t)=[F₁(t), F₂(t)]; {circle around (3)} the position information of particles x_(t)(τ)=[S_(NOt)(τ), S_(Ot)(τ)] is used as input in T iteration at time t; the fitness and skill factors of particles are calculated, and the particles are divided into different groups according to the skill factors; the fitness ranking of the particles are carried out; {circle around (4)} evaluate the validity of knowledge carried by particles: $\begin{matrix} {{E_{t}(t)} = \frac{\sum\limits_{m = 1}^{20}{\left( {{F_{t}^{m}(t)} - {{\overset{\_}{F}}_{t}(t)}} \right)\left( {{g_{t}^{m}(t)} - {\overset{\_}{g_{t}}(t)}} \right)}}{{s\left( {F_{t}(t)} \right)}{s\left( {g_{t}(t)} \right)}}} & (13) \end{matrix}$ where E_(t)(τ) is the knowledge validity of the τth iteration at time t, F^(m) _(t)(τ)=[F^(m) _(1t)(τ), F^(m) _(2t)(τ)] is the multi-task optimization fitness of the mth particle in τ iteration at time t, F^(m) _(1t)(τ) is the objective task fitness of the mth particle in τ iteration at time t, and F^(m) _(2t)(τ) is the auxiliary task fitness of the mth particle in τ iteration at time t; F _(t)(T)=[F _(1t)(τ), F _(2t)(τ)] is the mean of fitness for multi-task optimization in τ iteration at time t, F _(1t)(T) is the mean of fitness for the objective task in τ iteration at time t, F _(2t)(τ) is the mean of fitness for the auxiliary task in τ iteration at time t; F_(t)(τ)=[F_(1t)(τ), F_(2t)(τ)] is the fitness of multitask optimization in τ iteration at time t, F_(1t)(T) is the fitness of the objective task in τ iteration at time t, F_(2t)(τ) is the fitness of the auxiliary task in τ iteration at time t; g_(t)(τ) is the distance between the objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g^(m) _(t)(τ) is the distance between the mth objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g _(t)(τ) is the mean distance between the objective particle and the global optimal particle of the auxiliary task in τ iteration at time t; {circle around (5)} design the knowledge transfer strategy: $\begin{matrix} {{p_{tg}^{*}(t)} = \left\{ \begin{matrix} {p_{tJ}(t)} & {{E_{t}(t)} \leq {E_{t}\left( {t - 1} \right)}} \\ {p_{tJ}\left( {t - 1} \right)} & {{E_{t}(t)} > {E_{t}\left( {t - 1} \right)}} \end{matrix} \right.} & (14) \end{matrix}$ where P*_(tg)(T)=[p*_(tg,1)(τ), p*_(tg,2)(τ)] is the knowledge transfer term in τ iteration at time t, P_(tJ)(T)=[p_(tJ,1)(τ), p_(tJ,2)(τ)] is the global optimal solution of the auxiliary task in τ iteration at time t, P_(tJ)(τ−1)=[p_(tJ,1)(τ−1), p_(tJ,2)(τ−1)] is the global optimal solution of the auxiliary task in (τ−1) iteration at time t, and J is the solution with the highest knowledge validity in the Pareto optimal solution set of the auxiliary task at time t: J=argmin_(j∈{1,2, . . . ,M) }{E _(tj)(t)}  (15) where E_(tj)(τ) is the knowledge validity of the Jth particle in the Pareto optimal solution set of the auxiliary task in τ iteration at time t; the particle velocity update formula: v _(ti)(t+1)=wv _(ti)(t)+c ₁ r ₁(p _(ti)(t)−x _(ti)(t))+c ₂ r ₂(p _(tg)(t)−x _(ti)(t))+c ₃ r ₃(p* _(tg)(t)−x _(ti)(t))  (16) where v_(ti)(τ+1) is the velocity of the ith particle in (τ+1) iteration at time t, and v_(ti)(τ) is the velocity of the ith particle in τ iteration at time t, x_(ti)(τ+1) is the position of the ith particle in (τ+1) iteration at time t, and x_(ti)(τ) is the position of the ith particle in τ iteration at time t, P_(ti)(τ) is the individual optimal position of the ith particle in τ iteration at time t, and P_(tg)(τ) is the global optimal position of the ith particle in τ iteration at time t; ω=0.8 is the inertia weight; c₁=0.25 is the individual experience acceleration constant, c₂=0.25 is the social experience acceleration constant, c₃=0.25 is the knowledge transfer term acceleration constant; r₁ is the individual experience random number within [0, 1], r₂ is the social experience random number within [0, 1], r₃ is the knowledge transfer item random number within [0, 1]; {circle around (6)} by comparing the individual optimal position P_(ti)(τ) with the solution of the archive Φ_(t)(τ−1) in τ iteration at time t, the archive Φ_(t)(τ) is updated: $\begin{matrix} \left\{ {\begin{matrix} {{\Phi_{t}(\tau)} = {{\Phi_{t}\left( {\tau - 1} \right)}\bigcup{P_{ti}(\tau)}}} & {{if}{F_{1}\left( {\varphi_{t}\left( {\tau - \iota} \right)} \right)}\ldots{F_{1}\left( {P_{ti}(\tau)} \right)}} \\ {{\Phi_{t}(\tau)} = {\Phi_{t}\left( {\tau - 1} \right)}} & {else} \end{matrix},{\iota = 1},2,\ldots,{t - 1}} \right. & (17) \end{matrix}$ where ∪ is logic relationship “union”, Φ_(t)(τ−1)=[φ_(t)(τ−1), φ_(t)(τ−2), φ_(t)(τ−ι), . . . , φ_(t)(1)], φ_(t)(τ−ι) is the ιth optimal solution of archives in τ iteration, F₁(φ_(t)(τ−ι)) is the objective tasks fitness of φ_(t)(τ−ι), F₁(P_(ti)(τ)) is the objective tasks fitness of P_(ti)(τ); {circle around (7)} judge whether to stop iteration: if the current iteration number τ≥τ_(max), terminate the iteration process and go to step {circle around (8)}; otherwise, the iteration number τ increases by 1 and go back to step {circle around (3)}; {circle around (8)} a solution is randomly selected from the archives Φ_(t)(τ_(max)) as the optimal set-points at time t u*(t)=[S*_(NO)(t), S*_(O)(t)], where S*_(NO)(t) is the optimal set-point of nitrate nitrogen at time t and S*_(O)(t) is the optimal set-point of dissolved oxygen at time t; (4) track control of the optimal set-points: the multivariable proportion integral differential controller is used to track and control the optimal set-points, and the control signal is transmitted to the programmable logic controller though Object Linking and Embedding for Process Control of communication; the analog signal is converted to digital signal through the analog digital converter; the digital signal is transferred to the frequency converter by fieldbus, to control the frequency of oxygen supply pump and reflux pump, and realize the optimal control of effluent water quality and energy consumption for wastewater treatment process; {circle around (1)} proportion integral differential controller performs tracking control on the optimal set-points S*_(NO)(t) and S*_(O)(t): $\begin{matrix} {{\Delta{u(t)}} = {K_{p}\left\lbrack {{e(t)} + {H_{l}{\int_{0}^{t}{{e(t)}{dt}}}} + {H_{d}\frac{{de}(t)}{dt}}} \right\rbrack}} & (18) \end{matrix}$ where Δu(t)=[ΔQ_(a)(t), ΔK_(L)a(t)]^(T) is the operational variable matrix, ΔQ_(a)(t) is the change of the circulating flow, ΔK_(L)a(t) is the change of the oxygen transfer coefficient in the fifth zone; K_(p) is the proportional coefficient, H_(l) is the integral coefficient, H_(d) is the differential coefficient; e(t)=y*(t)−y(t) is control error at time t, y*(t)=[S*_(NO)(t), S*_(O)(t)]^(T) is the optimal set-points at time t, y(t)=[S_(NO)(t), S_(O)(t)]^(T) is the actual output values at time t; {circle around (2)} adjust the transfer coefficient of the dissolved oxygen and the internal return flow: K _(L) a(t+1)=K _(L) a(t)+ΔK _(L) a(t)  (19) Q _(a)(t+1)=Q _(a)(t)+ΔQ _(a)(t)  (20) where K_(L)a(t+1) is the transfer coefficient of dissolved oxygen at time (t+1), K_(L)a(t) is the transfer coefficient of the dissolved oxygen at time t; Q_(a)(t+1) is the inner return flow at time (t+1), Q_(a)(t) is the inner return flow at time t; when the frequency of oxygen supply pump and reflux pump is adjusted by frequency converter, the concentration of nitrate nitrogen will be adjusted to S*_(NO)(t) and the concentration of dissolved oxygen will be adjusted to S*_(O)(t); thus, the optimal control of effluent quality and energy consumption for wastewater treatment process is realized. 